class ServerError extends Error {
    constructor(code, msg) {
        super(msg);
        this.code = code;
    }

    toString() {
        return "Error : " + this.code + " , msg : " + super.message;
    }
}

ServerError.CODE = {
    ILLEGAL_ACCESS : -4,
    UNLOGIN : -3,
    UNKNOWN : -2,
    FAILED : -1,
    SUCCESS : 0,
    ILLEGAL_PARAMS : 1,
    EXISTS : 2,
    VERIFY_FAILED : 3
}

module.exports = ServerError;